<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>慢病档案</title>
    <%- include('../_global/baseLibsJKDA') %>
    <link rel="stylesheet" href="/static/css/jkda/public.css"/>
    <link rel="stylesheet" href="/static/css/jkda/page-main.css"/>
    <!--<link rel="stylesheet" href="/static/css/public.css">-->

    <style type="text/css">
        html, body {
            width: 100%;
            height: 100%;
            margin: 0px;
        }
        #ListTabBox .tab{ display: block!important;}
    </style>


</head>

<body>
<!-- <div class="search-nav">
  <i class="search"></i>
  <input type="text" placeholder="输入检查单号" id="JCDH" onkeyup="filterContent()">
</div> -->
<div id="ListTabBox">
    <div class="tab">
        <div class="mz-list">
            <ul id="mbda"></ul>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">


    var page_mbda = (function($, page_mbda) {

        function indata() {
            var zxwyh = $.QuickUrlUtils.getRequest("ZXWYH");
            $.QuickRemote.AjaxJson(goal_jkda_service+"/jkda/queryJkdaMbda", page_mbda.queryJkdaMbdaBack, {ZXWYH: zxwyh});
        }

        //慢病档案回调
        function queryJkdaMbdaBack(result) {
            page_mbda.appendToMbda(result);
        }
        //创建慢病档案信息
        function appendToMbda(result) {
            var lis = [];
            if (result.length != 0) {
                $(result).each(function () {
                    if (this["YWLX"] == "B0401a") {
                        var ywzys = this["YWZY"].split("%|%");
                        var mbda = ywzys[0].split("^|^");
                        var gldw = mbda[0];
                        var bfz = mbda[1];
                        var gljb = mbda[2];
                        var wxfc = mbda[3];
                        var li = $("<li>");
                        li.attr("style", "padding-top:12px");

                        var div1 = $("<div>");
                        div1.attr("class", "black-block");
                        var span1 = $("<span>");
                        span1.html("管理单位：");
                        span1.appendTo(div1);
                        var span2 = $("<span>");
                        span2.html(gldw);
                        span2.appendTo(div1);
                        div1.appendTo(li);

                        var div2 = $("<div>");
                        div2.attr("class", "black-block");
                        var span3 = $("<span>");
                        span3.html("并发症：");
                        span3.appendTo(div2);
                        var span4 = $("<span>");
                        span4.html(bfz);
                        span4.appendTo(div2);
                        div2.appendTo(li);

                        var div3 = $("<div>");
                        div3.attr("class", "black-block");
                        var span5 = $("<span>");
                        span5.html("管理级别：");
                        span5.appendTo(div3);
                        var span6 = $("<span>");
                        span6.html(gljb);
                        span6.appendTo(div3);
                        div3.appendTo(li);

                        var div4 = $("<div>");
                        div4.attr("class", "black-block");
                        var span7 = $("<span>");
                        span7.html("危险分层：");
                        span7.appendTo(div4);
                        var span8 = $("<span>");
                        span8.html(wxfc);
                        span8.appendTo(div4);
                        div4.appendTo(li);

                        div4 = $("<div>");
                        div4.attr("class", "black-block");
                        span7 = $("<span>");
                        span7.html("慢病类型：");
                        span7.appendTo(div4);
                        span8 = $("<span>");
                        span8.html("高血压");
                        span8.appendTo(div4);
                        div4.appendTo(li);

                        lis.push(li);
                    } else if (this["YWLX"] == "B0402a") {
                        var ywzys = this["YWZY"].split("%|%");
                        var mbda = ywzys[0].split("^|^");
                        var gldw = mbda[0];
                        var dxzt = mbda[1];
                        var tnbfx = mbda[2];
                        var li = $("<li>");
                        li.attr("style", "padding-top:12px");
                        var div1 = $("<div>");
                        div1.attr("class", "black-block");
                        var span1 = $("<span>");
                        span1.html("管理单位：");
                        span1.appendTo(div1);
                        var span2 = $("<span>");
                        span2.html(gldw);
                        span2.appendTo(div1);
                        div1.appendTo(li);

                        var div2 = $("<div>");
                        div2.attr("class", "black-block");
                        var span3 = $("<span>");
                        span3.html("对象状态：");
                        span3.appendTo(div2);
                        var span4 = $("<span>");
                        span4.html(dxzt);
                        span4.appendTo(div2);
                        div2.appendTo(li);

                        var div3 = $("<div>");
                        div3.attr("class", "black-block");
                        var span5 = $("<span>");
                        span5.html("糖尿病分型：");
                        span5.appendTo(div3);
                        var span6 = $("<span>");
                        span6.html(tnbfx);
                        span6.appendTo(div3);
                        div3.appendTo(li);


                        div3 = $("<div>");
                        div3.attr("class", "black-block");
                        span5 = $("<span>");
                        span5.html("慢病类型：");
                        span5.appendTo(div3);
                        span6 = $("<span>");
                        span6.html("糖尿病");
                        span6.appendTo(div3);
                        div3.appendTo(li);

                        lis.push(li);
                    }
                });
            } else {
                var li = $("<li>");
                var div0 = $("<div>");
                div0.attr("class", "black-block");

                div0.attr("style", "width:100%;text-align:center; font-weight:bold;color:#000;padding-top:20px");
                div0.html("暂无信息");

                div0.appendTo(li);

                lis.push(li);
            }
            $("#mbda").html(lis);
        }

        var cfg_def = {
            indata: indata,
            queryJkdaMbdaBack: queryJkdaMbdaBack,
            appendToMbda: appendToMbda,
        }

        page_mbda.init = function(cfg){
            $.extend(page_mbda, cfg_def, cfg);
            page_mbda.indata();

        }

        return page_mbda;
    })(jQuery, {});
    

</script>
</html>